package com.cgwx.commonutils.math.function;

/**
 * @author GaoWei
 * @Date 2021/8/6 - 9:24
 */
public class MinFunction implements Function
{
    @Override
    public double of(double[] d, int numParam)
    {
        if (numParam == 0)
        {
            return 4.9E-324D;
        }
        double min = 1.7976931348623157E+308D;
        for (int i = 0; i < numParam; i++)
        {
            if (d[i] < min)
            {
                min = d[i];
            }
        }
        return min;
    }

    @Override
    public boolean acceptNumParam(int paramInt)
    {
        return false;
    }
}
